<script src="<?php echo base_url() ?>commons/tablas/media/js/jquery.js" type="text/javascript"></script>
<script src="<?php echo base_url() ?>commons/tablas/media/js/jquery.dataTables.js" type="text/javascript"></script>
<style type="text/css" title="currentStyle">
			@import "<?php echo base_url() ?>commons/tablas/media/css/demo_page.css";
			@import "<?php echo base_url() ?>commons/tablas/media/css/demo_table.css";
		</style>
<script type="text/javascript">
    var t=jQuery.noConflict();
			t(document).ready(function() {
				t('#example').dataTable( {
					"sPaginationType": "full_numbers"
				} );
			} );
</script>
<!--
<div id="buscar"  >
    <form class="well form-search" action="<?php echo base_url() . "admin.php/ciclo/presearch" ?>" method="post" >
        <input type="text" class="input-medium search-query" name="txtsearch">
        <button type="submit" class="btn">Buscar</button>
    </form> 
</div>
-->
<div id="tabla1" >
    <table class="table  table-striped ">
        <thead>
            <tr>
                <th>CARRERA</th>
                <th>PENSUM</th>
                <th>CREAR</th>
            </tr>
        </thead>
        <tbody>
           <tr>
                <td>            
                <select name="ide_car" class="span2"
                        ONCHANGE="javascript:enviar(this.options[this.selectedIndex].value, '<?php echo (base_url()) . "admin.php/ciclo/inicio" ?>');">
                            <?php
                            if ($ide_car == -1)
                                echo ("<option value='-1' selected>Seleccionar Carrera</option>");
                            foreach ($carrera as $i => $car) {
                                echo ("<option value='" . $car["ide_car"] . "'");
                                echo (($ide_car == $car["ide_car"] ? " selected" : "") . ">");
                                echo ($car["nombre_car"] . "</option>");
                            }
                            ?>
                </select>

                 </td>
                <td>            
                    <select id="select02" name="ide_pen" class="span2"
                            ONCHANGE="javascript:enviar1('<?php echo (base_url()) . "admin.php/ciclo/inicio" ?>',
                                            '<?php echo $ide_car ?>', this.options[this.selectedIndex].value);">

                        <?php
                        if ($ide_pen == -1)
                            echo ("<option value='-1' selected>Seleccionar Pensum</option>");

                        foreach ($pensum as $i => $pen) {

                            echo ("<option value='" . $pen["ide_pen"] . "'");
                            echo (($ide_pen == $pen["ide_pen"] ? " selected" : "") . ">");
                            echo ($pen["descripcion_pen"] . "-" . $pen["estado_pen"] . "</option>");
                        }
                        ?>

                    </select>


                </td>
                 
                    <td>
                        <div id="agregar">
                            <form action="<?php echo base_url() . "admin.php/ciclo/crear" ?>" method="post" >
                                <input class="btn" type="submit"  value="Nueva Ciclo">


                            </form> 
                        </div>
                    </td>
            </tr>
            
        </tbody>
    </table>        
</div>

 <h3>LISTADO DE SEMESTRES POR CARRERAS </h3>
<div id="tabla" >
   
    <table id="example" class="table table-bordered table-striped table-condensed">
        <thead>
            <tr>
                <th>CARRERA</th>
                <th>NOMBRE MALLA</th>
                <th>ESTADO </th>
                <th>NOMBRE SEMESTRE</th>
                <th>OPC1</th>
                <th>OPC2</th>
                <!--

                <th colspan="2" align ="center">Acciones</th>
                -->
            </tr>
        </thead>
        <tbody>
            <?php
            if (!empty($ciclo)) {
                foreach ($ciclo as $i => $row) {
                    ?>
                    <tr>
                        <td><?php echo $row['nombre_car'] ?></td>
                        <td><?php echo $row['descripcion_pen'] ?></td>
                        <td><?php echo $row['estado_pen'] ?></td>
                        <td><?php echo $row['nombre_cic'] ?></td>
                        <td>
                            <a href='<?php echo (base_url() . "admin.php/ciclo/actualizar/upd/" . $row['ide_car'] . '/' . $row['ide_cic']); ?>'>
                                <i class="icon-edit"></i>Edit</a>
                        </td>
                        <td>
                            <a href='<?php echo (base_url() . "admin.php/ciclo/actualizar/del/" . $row['ide_car'] . '/' . $row['ide_cic']); ?>'>
                                <i class="icon-remove"></i>Elim</a></td>

                    </tr>
                    <?php
                }
            }
            ?>
        </tbody>
    </table>        
</div>



